<!DOCTYPE html>
<html lang="en">
<head>
      <meta charset="UTF-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>局部组件</title>
      <script src="vue.js"></script>
</head>
<body>
  <div id="id-div-comp">
        <comp-title></comp-title>
        <comp-content></comp-content>
        <comp-conter></comp-conter>
      </div>
  <script>
    var CompTitle = {
        template: '<h3>Title - Vue.js Global Component</h3>'
    };
    var CompContent = {
        template :'<p>原来是小瘪三</p >'
    };
    var CompCounter = {
        data: function() {
            return {
                count: 0
            }
        },
        template: '<button v-on:click="count++"> You clicked me {{ count }} times. </button>'
    };
    var vm = new Vue({
        el: '#id-div-comp',
        components: {
            'comp-title': CompTitle,
            'comp-content': CompContent,
            'comp-conter': CompCounter
        }
    });
</script>
</body>
</html>